// 引入数据库
const conn = require('../data/gy_index');
// 显示注册页面
module.exports.gy_register = (req, res) => {
   res.render('gy_register');
}
// 用户添加
module.exports.userAdd = (req, res) => {
   let sql = 'insert into users(gy_phone,gy_password,gy_name,gy_enterprise) values(?,?,?,?)';
   let data = [req.body.phone, req.body.password, req.body.users, req.body.enterprise];
   conn.query(sql, data, (eer, result) => {
      if (eer) return console.log(eer);
      res.json({
         code: '1200',
         message: '添加用户成功'
      })
   })
};

